Hypertext Transfer Protocol version 2 (HTTP/2) is a new version of the HTTP network protocol used by the World Wide Web. HTTP/2 is based on SPDY® which is an open networking protocol for transporting web content with goals of reducing web page load latency and improving web security.
SPDY® and its successor the HTTP/2 are open networking protocols for transporting web content with goals of reducing web page load latency and improving web security. This reduced latency is achieved by via compression, multiplexing, and prioritization of webpage sub-resources across a single connection per client.
To improve performance, the HTTP/2 RFC 7540 published in May 2015 (ISSN: 2070-1721) features stream prioritization management (for example, section 5.3 of the RFC 7540). This prioritization management provides a way to share limited system resources among parallel resource requests and responses. The algorithm provided for the prioritization management details how to satisfy a client's preferred prioritization and how to proceed when any or all of the preferred prioritizations cannot be satisfied at a given time.
The resource prioritization provided by HTTP/2 utilizes a tree data structure to specify priority. The priority tree orders streams based on dependencies. Nodes in the tree are processed according to their level or depth in the tree. Each stream may be a “child” stream that is dependent on another stream (referred to as the “parent”). The children are dependent on their parents such that each parent must be processed before its children.
Among children at the same level in the tree (i.e., “brothers”), relative weights may be assigned and utilized to determine the relative amount of resources to be allocated to each stream at the level, with the processing order of the brothers being arbitrarily assigned. Additionally, a stream in a priority tree may be exclusive, i.e., the only stream that depends immediately from its parent. If a stream is exclusive, other streams that would be dependent on the same parent instead become dependent on the exclusive stream.
Accordingly, each stream may be assigned a PRIORITY frame providing its stream dependency (i.e., its parent), its weight (relative to its brothers), and whether the stream is exclusively dependent. When no prioritization scheme is specified, default settings may be utilized. For example, all streams may initially be assigned a non-exclusive dependency on a root stream 0x0 with a default weight of 16.
If a new PRIORITY frame having priority data for an existing stream in the priority tree is provided, the existing stream (and any dependent streams) may be reprioritized accordingly by changing, e.g., the dependency, weight, or exclusivity. This reprioritization therefore affects the structure of the priority tree.
Streams having the same depth or level (hereinafter “degree relative” streams) within a priority tree may be considered to be related by degree. Degree relative streams do not necessarily share the same parent, but they are separated from the root node by the same degree. Additionally, the parents of degree relative streams are themselves degree relative streams. When allocating resources to nodes in the tree (e.g., when a buffer is created and needs to be allocated), the resources may be initially allocated to streams in a current set of degree relative streams. The current set of degree relative streams typically includes all degree relative streams in the first level of the priority tree having available nodes.
According to the HTTP/2 RFC, when a blocked stream is encountered, the resources allocated to the blocked stream should be reallocated and split among its children according to their relative weights. Additionally, the RFC suggests keeping track of genealogy among nodes in the tree at all times during streaming. This may increase computing resource usage and/or slow down streaming.
FIG. 1 is an example priority tree 100 utilized to demonstrate the relationships between degree relative streams. The example priority tree 100 includes a root node 110, two immediate children nodes 120 and 130, and three indirectly dependent nodes 140, 150, and 160. The nodes 120 and 130 are first degree relative streams, i.e., they are related in that each is immediately dependent on the root node 110. The nodes 140, 150, and 160 are second degree relative streams, i.e., they are related in that each is indirectly dependent on the root node 110 through one parent.
The weight initially assigned to each stream (e.g., via a HEADERS or PRIORITY frame as defined in the HTTP/2 RFC) is a relative weight indicating the amount of resources to be assigned to the stream relative to other streams. For example, in the tree 100, if nodes 120 and 130 have relative weights 16 and 32, respectively, then node 120 will carry 16/(16+32)=⅓ of the resources and node 130 will carry 32/(16+32)=⅔ of the resources.
The HTTP/2 RFC does not define a scheme for prioritization management that can dynamically and easily adapt to changing real world circumstances. For example, the HTTP/2 RFC does not define how the prioritization management should adapt the priorities when nodes of the tree are blocked, closed, missing a parent, or otherwise unavailable. The lack of an easy-to-adapt priority mechanism when transferring data using HTTP/2 may result in requiring feature data from backend servers, thereby slowing down resource retrieval and rendering of content (e.g. webpages) on web browsers.
It would therefore be advantageous to provide a solution that would overcome the deficiencies of the prior art.